package com.example.edu.Controller;

import com.example.edu.Dto.Return;
import com.example.edu.Dto.StudentAddDto;
import com.example.edu.Dto.StudentListDtoG;
import com.example.edu.Entity.Course;
import com.example.edu.Service.T_StudentService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/adminStudent")
public class T_StudentController {
    @Resource
    T_StudentService t_studentService;

    @PostMapping("/add")
    public Return add(@RequestBody StudentAddDto studentAddData){
        return t_studentService.add(studentAddData);
    }

    @PostMapping("/delete")
    public Return delete(@RequestBody StudentAddDto studentDeleteData){
        return t_studentService.delete(studentDeleteData);
    }

    @PostMapping("/getList")
    public Return getList(@RequestBody StudentListDtoG studentListData){
        return t_studentService.getList(studentListData);
    }
}
